Calibration of fixed image-capturing device for depth estimation

ABSTRACT

Calibration and distance prediction for driving assistance is provided. A camera of a vehicle is calibrated to obtain a distance data set. The distance data set includes a distance of each row of pixels of a first image captured by the camera. The distance data set may be further utilized in real-time to predict a distance of an object from the vehicle. Based on the predicted distance, a warning message for an impending collision may be generated and communicated to a driver of the vehicle, thereby facilitating driving assistance to the driver in the real-time.

CROSS-RELATED APPLICATIONS

This application claims priority of Indian Application Serial No.201941005110, filed Feb. 8, 2019, the contents of which are incorporatedherein by reference.

FIELD

Various embodiments of the disclosure relate generally to drivingassistance systems. More specifically, various embodiments of thedisclosure relate to calibration of a fixed image-capturing device fordepth estimation.

BACKGROUND

Advancements in the field of automobiles along with a continuouslyincreasing demand for personal and commercial vehicles have vastlyincreased the number of vehicles that are plying along various roads ona daily basis, thus increasing the traffic density. The increasedtraffic density of traffic on the roads has resulted in a rapid rise inthe number of collisions of the vehicles with stationary or movingobjects. Thus, driving a vehicle is becoming a complex procedure,especially along roads with the dense traffic. While driving through thedense traffic, a driver of the vehicle can encounter critical situationsthat the driver is unable to solve quickly and thus can cause accident.Hence, to avoid such accidents, it is imperative for the driver to beaware of the possible critical situations well in advance. In onepossible solution, the proximity of near-by objects (such as othervehicles, trees, pedestrians, and the like) is estimated andcommunicated to the driver for providing driving assistance whiledriving the vehicle. To facilitate providing the driving assistance tothe driver, the vehicle is equipped with various proximity sensors thatdetect presence of the near-by objects and estimate distances of eachnear-by object from the vehicle. However, the use of proximity sensorshas its own limitations. The proximity sensors are typicallyrange-specific and thus are not effective all the time. Further, anangle of coverage of a proximity sensor is typically small (e.g.,5°-15°). Hence, to ensure an entire coverage of the vehicle's path,multiple proximity sensors are installed on the vehicle, which may notdesirable due to increase in cost and complexity.

One conventional approach to solve the above-mentioned problems is touse a camera installed on the vehicle to estimate the distances of thenear-by objects from the vehicle. This conventional approach estimatesthe distance of a near-by object from the vehicle based on a ratiobetween observed dimensions of the object in an image captured by thecamera and actual dimensions of the object. However, with such approach,actual dimensions of various objects should be known beforehand, whichmay not be feasible all the time.

In light of the foregoing, there exists a need for a technical andreliable solution that overcomes the above-mentioned problems,challenges, and short-comings, and manages depth estimation of variousobjects for facilitating driving assistance to drivers of vehicles in amanner that may offer reliable and enhanced experiences to the drivers.

SUMMARY

Calibration of a fixed image-capturing device for depth estimation isprovided substantially as shown in, and described in connection with, atleast one of the figures, as set forth more completely in the claims.

These and other features and advantages of the disclosure may beappreciated from a review of the following detailed description of thedisclosure, along with the accompanying figures in which like referencenumerals refer to like parts throughout.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram that illustrates an environment forcalibration of fixed image-capturing devices of vehicles for depthestimation, in accordance with an exemplary embodiment of thedisclosure;

FIG. 2A illustrates an inside view of a vehicle of the environment ofFIG. 1, in accordance with an exemplary embodiment of the disclosure;

FIG. 2B illustrates an inside view of the vehicle, in accordance withanother exemplary embodiment of the disclosure;

FIG. 3A illustrates a calibration system for calibrating animage-capturing device of the environment of FIG. 1, in accordance withan exemplary embodiment of the disclosure;

FIG. 3B illustrates a first image captured by the image-capturingdevice, in accordance with an exemplary embodiment of the disclosure;

FIGS. 4A-4C, collectively, illustrate identification of first and secondrows of pixels in the first image of FIG. 3B corresponding to first andsecond calibration lines of FIG. 3A, respectively, in accordance with anexemplary embodiment of the disclosure;

FIG. 5A illustrates a second image including objects captured by theimage-capturing device, in accordance with an exemplary embodiment ofthe disclosure;

FIG. 5B illustrates predicted distances of the objects from the vehicle,in accordance with an exemplary embodiment of the disclosure;

FIGS. 6A and 6B illustrate a flow chart of a method for predictingdistance of an object from the vehicle, in accordance with an exemplaryembodiment of the disclosure;

FIG. 6C illustrates a flowchart of a method for identifying the firstand second rows of pixels corresponding to the first and secondcalibration lines, respectively, in accordance with an exemplaryembodiment of the disclosure; and

FIG. 7 is a block diagram that illustrates a computer system forcalibrating a fixed image-capturing device of a vehicle and predicting adistance of an object from the vehicle, in accordance with an exemplaryembodiment of the disclosure.

DETAILED DESCRIPTION

Certain embodiments of the disclosure may be found in a disclosedapparatus for calibration of a fixed image-capturing device of a vehiclefor depth estimation. Exemplary aspects of the disclosure provide amethod and a system for calibrating the fixed image-capturing device ofthe vehicle and predicting a distance of an object from the vehicle. Themethod includes one or more operations that are executed by circuitry ofthe disclosed apparatus to perform calibration of the fixedimage-capturing device. The circuitry may be configured to identify afirst plurality of rows of pixels in a first image. The first image maybe captured by the image-capturing device. The first image may include aplurality of lines. A first line of the plurality of lines is at a knowndistance from a second line of the plurality of lines. The firstplurality of rows of pixels may correspond to the plurality of lines.The circuitry may be further configured to estimate a first distance anda second distance of the first line and the second line, respectively,from the image-capturing device. The first and second distances areestimated based on at least the known distance, a first width of thefirst line in the first image, and a second width of the second line inthe first image. The circuitry may be further configured to estimate athird distance of a third line corresponding to each row of pixels of asecond plurality of rows of pixels in the first image from theimage-capturing device. The third distance may be estimated based on atleast a focal length of the image-capturing device and a third width ofthe third line corresponding to each row of pixels. The third width maybe estimated based on at least the plurality of lines and each row ofpixels. The first image may comprise the first plurality of rows ofpixels and the second plurality of rows of pixels. The circuitry may befurther configured to store a distance data set including at least thefirst distance, the second distance, and the third distance in a memory.Further, a fourth distance of a first object from a second object may bepredicted based on the stored distance data set and a second image ofthe first object.

Another exemplary aspect of the disclosure provides a method and asystem for predicting a distance of an object from a vehicle. The methodincludes one or more operations that are executed by a vehicle deviceinstalled in the vehicle. In one embodiment, the vehicle device mayinclude circuitry such as an image-capturing device, a processor, and amemory. In another embodiment, the vehicle device may only includecircuitry such as a processor and a memory, and the image-capturingdevice and the vehicle device may be separate from each other. In anembodiment, the image-capturing device may be configured to capture afirst image of a first object. The processor may be configured to detecta bottom edge of the first object based on the first image. Theprocessor may be further configured to identify a first row of pixels inthe first image corresponding to the detected bottom edge. The processormay be further configured to predict a first distance of the firstobject from the vehicle based on a distance value retrieved from adistance data set that may be stored in the memory of the vehicle deviceor a separate memory device installed in the vehicle. The distance valuemay be retrieved from the distance data set based on at least the firstrow of pixels.

The distance data set may be estimated by executing one or morecalibration operations. For example, a second plurality of rows ofpixels in a second image including a plurality of lines may beidentified. The second plurality of rows of pixels may correspond to theplurality of lines. A first line of the plurality of lines may be aknown distance from a second line of the plurality of lines. Further, asecond distance and a third distance of the first line and second line,respectively, from a second object may be estimated. The second distanceand the third distance are estimated based on at least the knowndistance, a first width of the first line in the second image, and asecond width of the second line in the second image.

Further, the distance data set for a third line corresponding to eachrow of pixels of a third plurality of rows of pixels in the second imagemay be estimated based on at least a third width of the third linecorresponding to each of the third plurality of rows of pixels and oneof the first line or the second line. Each distance value in thedistance data set may indicate a distance of the third linecorresponding to each row of pixels of the third plurality of rows ofpixels from the second object. The third width may be estimated based onat least the plurality of lines and each row of pixels of the thirdplurality of rows of pixels. The distance data set may further includeat least the second distance and the third distance. The second imagemay comprise the second plurality of rows of pixels and the thirdplurality of rows of pixels. The retrieved distance value may beassociated with a fourth row of pixels in the second image having a rownumber that is equal to a row number of the first row of pixels in thefirst image. Upon prediction of the distance of the first object fromthe vehicle, the processor may be configured to generate a warningmessage based on at least the predicted distance. The processor may befurther configured to communicate the warning message to a driver of thevehicle indicating an impending collision.

Thus, various methods and systems of the disclosure facilitatecalibration of a fixed image-capturing device of a vehicle to obtaindistance data set that is further utilized to predict a distance of afirst object from the vehicle in real-time. The distance data set may beobtained by identifying a plurality of rows of pixels and determiningcorresponding distances by utilizing line correspondences of a pluralityof lines on a ground plane. The plurality of lines may be mapped to aplurality of rows of pixels in an image captured by the fixedimage-capturing device during the calibration of the fixedimage-capturing device. Thus, the accuracy of identification of theplurality rows of pixels and determination of the distance data set maybe higher as compared to conventional distance prediction approachesthat use point correspondences. Further, since distances of the distancedata set may be estimated based on the plurality of lines on the groundplane, and distances of various objects (such as the first object) fromthe vehicle may be predicted based on the distance data set, abeforehand need for knowing actual dimensions of the various objects iseliminated. Thus, the various methods and systems of the disclosurefacilitate an efficient, effective, and accurate way of identifyingvarious obstacles, predicting distances of each obstacle, and notifyinga driver of the vehicle of an impending collision, if any, well inadvance.

FIG. 1 is a block diagram that illustrates an environment 100 forcalibration of fixed image-capturing devices of vehicles for depthestimation, in accordance with an exemplary embodiment of thedisclosure. The environment 100 includes a vehicle 102, a vehicle device104 including an image-capturing device 106, a processor 108, and amemory 110, an image-capturing device 112, a vehicle device 114including a processor 116 and a memory 118, an application server 120,and a database server 122 that communicate with each other via acommunication network 124.

In an embodiment, the vehicle 102 may include a distance predictionmechanism. The distance prediction mechanism may facilitate detection ofa first object in front of the vehicle 102 and prediction of a firstdistance of the first object from the vehicle 102. Examples of the firstobject may include, but are not limited to, a pedestrian, an animal, avehicle, a road-divider, a non-drivable area, a rock, a road sign, abuilding, and a tree. For facilitating prediction of the first distancein real-time, the distance prediction mechanism may be calibrated. Thus,the vehicle 102 may be subjected to a calibration phase (in which thedistance prediction mechanism may be calibrated) and an implementationphase (in which the distance prediction mechanism may predict the firstdistance based on the calibration). In an embodiment, the distanceprediction mechanism may be realized or implemented by the vehicledevice 104 including the image-capturing device 106, the processor 108,and the memory 110. In another embodiment, the distance predictionmechanism may be realized or implemented by a combination of theimage-capturing device 112 and the vehicle device 114 including theprocessor 116 and the memory 118. Here, the image-capturing device 112and the vehicle device 114 are separate devices installed in the vehicle102. In another embodiment, the distance prediction mechanism may berealized or implemented by a combination of the image-capturing device106 or 112, the application server 120, and the database server 122.

The vehicle 102 is a mode of transportation that is used by a user tocommute from one location to another location. In an embodiment, thevehicle 102 may be owned by the user. In another embodiment, the vehicle102 may be owned by a vehicle service provider for offering on-demandvehicle or ride services to one or more passengers (e.g., the user). Thevehicle 102 may include one or more vehicle devices such as the vehicledevice 104 or the vehicle device 114. Examples of the vehicle 102include, but are not limited to, an automobile, a bus, a car, anauto-rickshaw, and a bike.

The vehicle device 104 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations. The vehicle device 104 maybe a computing device that is installed in the vehicle 102. Examples ofthe vehicle device 104 may include, but are not limited to, a mobilephone, a tablet, a laptop, a vehicle head unit, or any other portablecommunication device that is placed inside the vehicle 102. The vehicledevice 104 may be realized through various web-based technologies suchas, but not limited to, a Java web-framework, a .NET framework, a PHP(Hypertext Preprocessor) framework, or any other web-applicationframework. The vehicle device 104 may be further realized throughvarious embedded technologies such as, but not limited to,microcontrollers or microprocessors that are operating on one or moreoperating systems such as Windows, Android, Unix, Ubuntu, Mac OS, or thelike.

In an embodiment, the vehicle device 104 may be installed on a frontwindshield (shown in FIGS. 2A and 3A) of the vehicle 102. Further, thevehicle device 104 may be installed such that the image-capturing device106 is positioned at a center of the front windshield and may beoriented to face outside the vehicle 102 for capturing various objects(such as the first object) present in front of the vehicle 102. Inanother embodiment, the vehicle device 104 may be installed behind thefront windshield of the vehicle 102. Further, the vehicle device 104 maybe installed such that the image-capturing device 106 is positioned at acenter of the front windshield and may be oriented to face outside thevehicle 102 for capturing the various objects (such as the first object)present in front of the vehicle 102. In another embodiment, the vehicledevice 104 may be installed on a rear windshield (not shown) of thevehicle 102. Further, the vehicle device 104 may be installed such thatthe image-capturing device 106 is positioned at a center of the rearwindshield and may be oriented to face outside the vehicle 102 forcapturing the various objects present behind the vehicle 102.

In an embodiment, the vehicle device 104 may be calibrated in thecalibration phase. Based on the calibration, the vehicle device 104 maybe configured to predict the first distance of the first object from thevehicle 102 in the implementation phase. The vehicle device 104 may beconfigured to execute the calibration and implementation phases byutilizing the image-capturing device 106, the processor 108, and thememory 110. The image-capturing device 106, the processor 108, and thememory 110 may communicate with each other via a first communication bus(not shown).

The image-capturing device 106 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations. For example, theimage-capturing device 106 may be an optical instrument that includesone or more image sensors for recording or capturing a set of images.The set of images may be individual still photographs or a sequence ofimages constituting a video. In an embodiment, the image-capturingdevice 106 may be a red, green, and blue (RGB) camera. Thus, the set ofimages (captured by the image-capturing device 106) may be associatedwith an RGB color model. However, a person having ordinary skill in theart would understand that the scope of the disclosure is not limited tothis specific scenario in which the image-capturing device 106 may beconfigured to capture the set of images associated with the RGB colormodel. In various other embodiments, the set of images captured by theimage-capturing device 106 may be associated with a different colormodel such as a black and white color model, a greyscale color model, ahue, saturation, and value (HSV) color model, a cyan, magenta, yellow,and black (CMYK) color model, a hue, saturation, and brightness (HSB)color model, a hue, saturation, and lightness (HSL) color model, a hue,chroma, and value (HCV) color model, or the like.

In an embodiment, in the calibration phase, the image-capturing device106 may be configured to capture a first image (shown in FIGS. 3B and4A) of a calibration system or environment (shown in FIG. 3A). In oneexample, the image-capturing device 106 may automatically capture thefirst image. In another example, the image-capturing device 106 maycapture the first image of the calibration system based on an inputtriggered by an individual such as an administrator who is monitoringand managing the calibration phase.

In an embodiment, the calibration system or environment (hereinafter,“the calibration system”) may include the vehicle 102, a carpet (shownin FIGS. 3A and 4A), and first and second calibration lines (shown inFIGS. 3A, 3B, and 4A) painted on the carpet. The first and secondcalibration lines may be perpendicular to a path of the vehicle 102. Inanother embodiment, the calibration system may include the vehicle 102and third and fourth calibration lines (not shown) drawn on a groundplane (not shown) and the third and fourth calibration lines may beperpendicular to the path of the vehicle 102. In another embodiment, thecalibration system may include the vehicle 102 and first and secondcolored tapes (not shown) pasted on the ground plane and the first andsecond colored tapes may be perpendicular to the path of the vehicle102. In another embodiment, the calibration system may include thevehicle 102 and an enclosed space (not shown) with first and second rowsof lights (not shown). The first and second rows of lights may beperpendicular to the path of the vehicle 102. The first and secondcalibration lines may be at a known distance from each other. Similarly,the third and fourth calibration lines may be at the known distance fromeach other. Further, the first and second colored tapes may be at theknown distance from each other, and the first and second rows of lightsmay be at the known distance from each other. Further, the first andsecond calibration lines, the third and fourth calibration lines, thefirst and second colored tapes, and the first and second rows of lightsmay be associated with known widths.

For the sake of ongoing description, it is assumed that the calibrationsystem includes the carpet laid in front of the vehicle 102 with thefirst and second calibration lines painted on the carpet. It is furtherassumed that the first and second calibration lines are having equalknown widths (for example, 2 meters (m)) and are at the known distancefrom each other. It will be apparent to a person skilled in the art thatthe scope of the disclosure is not limited to the calibration systemincluding only two calibration lines (such as the first and secondcalibration lines, the third and fourth calibration lines, the first andsecond colored tapes, or the first and second rows of lights). Invarious other embodiments, the calibration phase may be realized byusing more than two calibration lines. Thus, the first image of thecalibration system may include at least the carpet along with the firstand second calibration lines painted on the carpet. Upon capturing ofthe first image of the calibration system, the image-capturing device106 may be configured to transmit the first image (e.g., image dataassociated with the first image) to the processor 108, store the firstimage in the memory 110, transmit the first image to the applicationserver 120, or transmit the first image to the database server 122.

In an embodiment, in the implementation phase, the image-capturingdevice 106 may be configured to capture a second image (shown in FIGS.5A and 5B) of a road (or a route segment) along which the vehicle 102 iscurrently traversing. Upon capturing of the second image, theimage-capturing device 106 may be configured to transmit the secondimage (e.g., image data associated with the second image) to theprocessor 108, store the second image in the memory 110, transmit thesecond image to the application server 120, or transmit the second imageto the database server 122. The second image may include one or moreobjects (such as the first object) or a portion of the one or moreobjects that are present in a capturing range of the image-capturingdevice 106. In some embodiments, the second image may include variousother objects apart from the first object. Examples of such objectsinclude, but are not limited to, pedestrians, animals, other vehicles,road-dividers, non-drivable areas, rocks, road signs, buildings, andtrees. For the sake of ongoing description, it is assumed that thedistance prediction mechanism predicts the first distance of the firstobject from the vehicle 102. In some embodiments, the distanceprediction mechanism may also predict distances of various other objectsfrom the vehicle 102 in a manner similar to the prediction of the firstdistance of the first object from the vehicle 102.

The processor 108 may include suitable logic, circuitry, interfaces,and/or codes, executable by the circuitry, that may be configured toperform one or more operations. Examples of the processor 108 mayinclude, but are not limited to, an application-specific integratedcircuit (ASIC) processor, a reduced instruction set computing (RISC)processor, a complex instruction set computing (CISC) processor, and afield-programmable gate array (FPGA). It will be apparent to a personskilled in the art that the processor 108 may be compatible withmultiple operating systems.

In an embodiment, the one or more operations may be associated with thecalibration phase and the implementation phase. In an embodiment, in thecalibration phase, the processor 108 may be configured to receive thefirst image from the image-capturing device 106. The processor 108 maybe further configured to process the first image to identify first andsecond rows of pixels (shown in FIG. 3B) in the first image. The firstand second rows of pixels (i.e., a first plurality of rows of pixels)may correspond to the first and second calibration lines painted on thecarpet, respectively. The processor 108 may be further configured toestimate a second distance and a third distance of the first calibrationline and the second calibration line, respectively, from the vehicle 102(or the image-capturing device 106 of the vehicle 102). The processor108 may estimate the second and third distances based on the knowndistance between the first and second calibration lines, a width of thefirst calibration line as observed in the first image (hereinafter, “afirst observed width”), and a width of the second calibration line asobserved in the first image (hereinafter, “a second observed width”).The processor 108 may be further configured to estimate a focal lengthof the image-capturing device 106 based on at least the firstcalibration line or the second calibration line. In an example, theprocessor 108 may estimate the focal length of the image-capturingdevice 106 based on the second distance of the first calibration linefrom the vehicle 102 (or the image-capturing device 106 of the vehicle102), the known width (e.g., 2 m) of the first calibration line on thecarpet, and the first observed width. In another example, the processor108 may estimate the focal length of the image-capturing device 106based on the third distance of the second calibration line from thevehicle 102 (or the image-capturing device 106 of the vehicle 102), theknown width (e.g., 2 m) of the second calibration line on the carpet,and the second observed width. The known distance and the known widthsare shown in FIG. 3A, and the first and second observed widths are shownin FIG. 3B.

In an embodiment, the processor 108 may be further configured toestimate a width of each line corresponding to each of remaining rows ofpixels (i.e., a second plurality of rows of pixels) in the first image.For example, for each remaining row of pixels in the first image, theprocessor 108 may be configured to determine the width of acorresponding line based on a fourth distance between the correspondingrow of pixels and the first or second row of pixels, the first andsecond observed widths, and a first angle. The first angle may beobtained by joining the same ends of the first and second calibrationlines (as shown in FIG. 3B). The remaining rows of pixels in the firstimage may correspond to the second plurality of rows of pixels in thefirst image that does not include the first plurality of rows of pixels(i.e., the first and second rows of pixels). The processor 108 may befurther configured to estimate a fifth distance of a line correspondingto each remaining row of pixels in the first image from the vehicle 102(or the image-capturing device 106 of the vehicle 102) based on at leastthe estimated width of the corresponding line, the known width, and thefocal length of the image-capturing device 106. Thus, each row of pixelsin the first image may be associated with a corresponding distance fromthe vehicle 102 (or the image-capturing device 106 of the vehicle 102).In an embodiment, the processor 108 may be further configured to storethe second and third distances of the first and second calibration linesalong with the estimated fifth distances associated with the remainingrows of pixels in the memory 110. The second and third distances and theestimated fifth distances may be collectively referred to as, “adistance data set” that is obtained from the calibration phase. Inanother embodiment, the processor 108 may be further configured to storethe distance data set in the database server 122.

In an embodiment, in the implementation phase, the processor 108 may beconfigured to receive the second image from the image-capturing device106. The processor 108 may be further configured to process the secondimage to identify the one or more objects (such as the first object)captured in the second image. Further, the processor 108 may beconfigured to detect a first bottom edge of the first object. Theprocessor 108 may be further configured to identify, in the secondimage, a third row of pixels associated with the first bottom edge. Inan embodiment, based on the third row of pixels, the processor 108 maybe further configured to retrieve a first distance value from thedistance data set stored in the memory 110. In another embodiment, basedon the third row of pixels, the processor 108 may be configured totransmit a query to the database server 122 to retrieve the firstdistance value from the distance data set stored in the database server122. The first distance value may correspond to a fourth row of pixelsin the first image having a row number that is equal to a row number ofthe third row of pixels in the second image. Thereafter, the processor108 may be configured to predict the first distance of the first objectfrom the vehicle 102 based on at least the retrieved first distancevalue. Based on the predicted first distance, the processor 108 may beconfigured to generate a warning message and communicate the warningmessage to a driver of the vehicle 102 to provide driving assistance inreal-time. For example, if the first distance is less than a thresholdvalue, the processor 108 may generate the warning message indicating animpending collision, for example, the generated warning message may readas “Hey driver! There is an obstacle at 5 m from your vehicle. Thechances of the impending collision with the obstacle is high if youdrive at the current speed. Go slow!!”. Further, the processor 108 maycommunicate the warning message to the driver. The warning message maybe communicated to the driver by communicating a short message service(SMS), an audio message, a video message, a haptic message, or the like.

The memory 110 may include suitable logic, circuitry, interfaces, and/orcodes, executable by the circuitry, that may be configured to store oneor more instructions that are executed by the image-capturing device 106or the processor 108 to perform their operations. The memory 110 may beconfigured to store the first image, the second image, and the distancedata set. Examples of the memory 110 may include, but are not limitedto, a random-access memory (RAM), a read-only memory (ROM), aprogrammable ROM (PROM), and an erasable PROM (EPROM).

The image-capturing device 112 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations. For example, theimage-capturing device 112 may be an optical instrument that includesone or more image sensors for recording or capturing a set of images.The set of images may be individual still photographs or a sequence ofimages constituting a video. In an embodiment, the image-capturingdevice 112 may be installed on the front windshield of the vehicle 102such that the image-capturing device 112 is positioned at a center ofthe front windshield and may be oriented to face outside the vehicle 102for capturing the various objects (such as the first object) present infront of the vehicle 102. In another embodiment, the image-capturingdevice 112 may be installed behind the front windshield such that theimage-capturing device 112 is positioned at a center of the frontwindshield and may be oriented to face outside the vehicle 102 forcapturing the various objects present in front of the vehicle 102. Inanother embodiment, the image-capturing device 112 may be installed onthe rear windshield of the vehicle 102 such that the image-capturingdevice 112 is positioned at a center of the rear windshield and may beoriented to face outside the vehicle 102 for capturing the variousobjects present behind the vehicle 102. The image-capturing device 112may be connected to the vehicle device 114 via the communication network124 or a second communication bus (not shown). Further, theimage-capturing device 112 may be connected to the application server120 via the communication network 124.

In an embodiment, in the calibration phase, the image-capturing device112 may be configured to capture the first image of the calibrationsystem and transmit the first image to the vehicle device 114 or theapplication server 120. In an embodiment, in the implementation phase,the image-capturing device 112 may be configured to capture the secondimage of the road (or the route segment) along which the vehicle 102 iscurrently traversing. Upon capturing of the second image, theimage-capturing device 112 may be configured to transmit the secondimage to the processor 116, store the second image in the memory 118,transmit the second image to the application server 120, or transmit thesecond image to the database server 122. The second image may includethe one or more objects (such as the first object) or a portion of theone or more objects that are present in a capturing range of theimage-capturing device 112. The image-capturing device 112 may bestructurally and functionally similar to the image-capturing device 106.However, the image-capturing device 106 is embedded within the vehicledevice 104 whereas the image-capturing device 112 is a stand-alonedevice.

The vehicle device 114 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations. The vehicle device 114 maybe a computing device that is installed in the vehicle 102. Examples ofthe vehicle device 114 may include, but are not limited to, a mobilephone, a tablet, a laptop, a vehicle head unit, or any other portablecommunication device that is placed inside the vehicle 102. The vehicledevice 114 may be realized through various web-based technologies suchas, but not limited to, a Java web-framework, a .NET framework, a PHPframework, or any other web-application framework. The vehicle device114 may be further realized through various embedded technologies suchas, but are not limited to, microcontrollers or microprocessors that areoperating on one or more operating systems such as Windows, Android,Unix, Ubuntu, Mac OS, or the like.

In an embodiment, the vehicle device 114 may be communicativelyconnected to the image-capturing device 112 for receiving one or moreimages (such as the first image and the second image) captured by theimage-capturing device 112. The vehicle device 114 may be configured toexecute various processes of the calibration and implementation phasesby utilizing the processor 116 and the memory 118. In an embodiment, theprocessor 116 and the memory 118 may communicate with each other via athird communication bus (not shown).

The processor 116 may include suitable logic, circuitry, interfaces,and/or codes, executable by the circuitry, that may be configured toperform one or more operations. Examples of the processor 116 mayinclude, but are not limited to, an ASIC processor, a RISC processor, aCISC processor, and an FPGA. It will be apparent to a person skilled inthe art that the processor 116 may be compatible with multiple operatingsystems.

In an embodiment, the one or more operations may be associated with thecalibration phase and the implementation phase. In an embodiment, in thecalibration phase, the processor 116 may be configured to receive thefirst image from the image-capturing device 112. The processor 116 maybe further configured to process the first image to identify the firstand second rows of pixels in the first image. The first and second rowsof pixels (i.e., the first plurality of rows of pixels) may correspondto the first and second calibration lines. The processor 116 may befurther configured to estimate a second distance and a third distance ofthe first calibration line and the second calibration line,respectively, from the vehicle 102 (or the image-capturing device 106 ofthe vehicle 102). The processor 116 may estimate the second and thirddistances based on the known distance between the first and secondcalibration lines, the first observed width, and the second observedwidth. Based on at least the first calibration line or the secondcalibration line, the processor 116 may be further configured toestimate the focal length of the image-capturing device 112. In anexample, the processor 116 may estimate the focal length of theimage-capturing device 112 based on the second distance of the firstcalibration line from the vehicle 102 (or the image-capturing device 112of the vehicle 102), the known width of the first calibration line onthe carpet, and the first observed width. In another example, theprocessor 116 may estimate the focal length of the image-capturingdevice 112 based on the third distance of the second calibration linefrom the vehicle 102 (or the image-capturing device 112 of the vehicle102), the known width of the second calibration line on the carpet, andthe second observed width.

In an embodiment, the processor 116 may be further configured toestimate the width of each line corresponding to each of remaining rowsof pixels (i.e., the second plurality of rows of pixels) in the firstimage. For example, for each remaining row of pixels in the first image,the processor 116 may determine the width of the corresponding linebased on the fourth distance, the first and second observed widths, andthe first angle. The processor 116 may be further configured to estimatethe fifth distance of a line corresponding to each remaining row ofpixels in the first image from the vehicle 102 (or the image-capturingdevice 112 of the vehicle 102) based on at least the estimated width ofthe corresponding line, the known width, and the focal length of theimage-capturing device 112. Thus, each row of pixels in the first imagemay be associated with a corresponding distance from the vehicle 102 (orthe image-capturing device 112 of the vehicle 102). In an embodiment,the processor 116 may be further configured to store the distance dataset (i.e., the second and third distances and the estimated fifthdistances) in the memory 118. In another embodiment, the processor 116may be further configured to store the distance data set in the databaseserver 122.

In an embodiment, in the implementation phase, the processor 116 may beconfigured to receive the second image from the image-capturing device112. The processor 116 may be further configured to process the secondimage to identify the one or more objects (such as the first object)captured in the second image. Further, the processor 116 may beconfigured to detect the first bottom edge of the first object. Theprocessor 116 may be further configured to identify, in the secondimage, the third row of pixels associated with the first bottom edge. Inan embodiment, based on the third row of pixels, the processor 116 maybe further configured to retrieve the first distance value from thedistance data set stored in the memory 118. In another embodiment, basedon the third row of pixels, the processor 116 may be further configuredto transmit a query to the database server 122 to retrieve the firstdistance value from the distance data set stored in the database server122. The first distance value may correspond to the fourth row of pixelsin the first image having a row number that is equal to a row number ofthe third row of pixels in the second image. Thereafter, the processor116 may be configured to predict the first distance of the first objectfrom the vehicle 102 based on at least the retrieved first distancevalue. Based on the predicted first distance, the processor 116 may beconfigured to generate the warning message and communicate the warningmessage to the driver of the vehicle 102 to provide driving assistancein real-time. Additionally, the processor 116 may generate the warningmessage based on the predicted first distance and speed of the vehicle102.

The memory 118 may include suitable logic, circuitry, interfaces, and/orcodes, executable by the circuitry, that may be configured to store oneor more instructions that are executed by the processor 116 to performthe one or more operations. The memory 118 may be configured to storethe first image, the second image, and the distance data set. Examplesof the memory 118 may include, but are not limited to, a RAM, a ROM, aPROM, and an EPROM.

The application server 120 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations for device calibration anddepth estimation. The application server 120 may be a computing device,which may include a software framework, that may be configured to createthe application server implementation and perform the various operationsassociated with the device calibration and depth estimation. Theapplication server 120 may be realized through various web-basedtechnologies, such as, but not limited to, a Java web-framework, a .NETframework, a PHP framework, a python framework, or any otherweb-application framework. Examples of the application server 120 mayinclude, but are not limited to, a personal computer, a laptop, or anetwork of computer systems. The application server 120 may becommunicatively connected to the vehicle device 104 or theimage-capturing device 112 and vehicle device 114 via the communicationnetwork 124.

In an exemplary embodiment, the application server 120 may be configuredto receive the first image from the image-capturing device 112. Theapplication server 120 may be further configured to process the firstimage to identify the first and second rows of pixels in the first imagecorresponding to the first and second calibration lines, respectively.The application server 120 may be further configured to estimate thesecond distance and the third distance of the first calibration line andthe second calibration line, respectively, from the vehicle 102 (or theimage-capturing device 112 of the vehicle 102). The application server120 may estimate the second and third distances based on the knowndistance between the first and second calibration lines, the firstobserved width, and the second observed width. Based on at least thefirst calibration line or the second calibration line, the applicationserver 120 may be further configured to estimate the focal length of theimage-capturing device 112. The application server 120 may be furtherconfigured to estimate, for each remaining row of pixels in the firstimage, the width of the corresponding line based on the fourth distance,the first and second observed widths, and the first angle. Theapplication server 120 may be further configured to estimate the fifthdistance of a line corresponding to each remaining row of pixels fromthe vehicle 102 (or the image-capturing device 112 of the vehicle 102)based on the estimated width of the corresponding line, the known width,and the focal length. Thus, each row of pixels in the first image may beassociated with a corresponding distance from the vehicle 102 (or theimage-capturing device 112 of the vehicle 102). In an embodiment, theapplication server 120 may be further configured to store the distancedata set (i.e., the second and third distances and the estimated fifthdistances) in the database server 122.

In an embodiment, in the implementation phase, the application server120 may be configured to receive the second image from theimage-capturing device 112. The application server 120 may be furtherconfigured to process the second image to identify the one or moreobjects (such as the first object) captured in the second image.Further, the application server 120 may be configured to detect thefirst bottom edge of the first object and identify the third row ofpixels associated with the first bottom edge in the second image. Basedon the third row of pixels, the application server 120 may be furtherconfigured to transmit a query to the database server 122 to retrievethe first distance value from the distance data set stored in thedatabase server 122. The first distance value may correspond to thefourth row of pixels in the first image having a row number that isequal to a row number of the third row of pixels in the second image.Thereafter, the application server 120 may be configured to predict thefirst distance of the first object from the vehicle 102 based on atleast the retrieved first distance value. Based on the predicted firstdistance, the application server 120 may be further configured togenerate the warning message and communicate the warning message to thedriver of the vehicle 102 to provide driving assistance in real-time.

The database server 122 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to perform one or more operations, such as receiving,storing, processing, and transmitting queries, data, or content. Thedatabase server 122 may be a data management and storage computingdevice that is communicatively coupled to the vehicle device 104, theimage-capturing device 112, the vehicle device 114, and the applicationserver 120 via the communication network 124 to perform the one or moreoperations. In an exemplary embodiment, the database server 122 may beconfigured to manage and store one or more images (such as the firstimage) captured by the image-capturing device 106 or 112. The databaseserver 122 may be further configured to manage and store one or moreimages (such as the second image) captured by the image-capturing device106 or 112. The database server 122 may be further configured to manageand store the distance data set. The database server 122 may be furtherconfigured to manage and store one or more warning messagescorresponding to one or more first distances of the one or more objectsfrom the vehicle 102.

In an embodiment, the database server 122 may be configured to receiveone or more queries from the processor 108, the processor 116, or theapplication server 120 via the communication network 124. Each query maycorrespond to an encrypted message that is decoded by the databaseserver 122 to determine a request for retrieving requisite information.In response to each received query, the database server 122 may beconfigured to retrieve and communicate the requested information to theprocessor 108, the processor 116, or the application server 120 via thecommunication network 124. Examples of the database server 122 include,but are not limited to, a personal computer, a laptop, or a network ofcomputer systems.

The communication network 124 may include suitable logic, circuitry,interfaces, and/or code, executable by the circuitry, that may beconfigured to transmit queries, data, content, messages, and requestsbetween various entities, such as the vehicle device 104, theimage-capturing device 112, the vehicle device 114, the applicationserver 120, and/or the database server 122. Examples of thecommunication network 124 include, but are not limited to, a wirelessfidelity (Wi-Fi) network, a light fidelity (Li-Fi) network, a local areanetwork (LAN), a wide area network (WAN), a metropolitan area network(MAN), a satellite network, the Internet, a fiber optic network, acoaxial cable network, an infrared (IR) network, a radio frequency (RF)network, and a combination thereof. Various entities in the environment100 may connect to the communication network 124 in accordance withvarious wired and wireless communication protocols, such as TransmissionControl Protocol and Internet Protocol (TCP/IP), User Datagram Protocol(UDP), Long Term Evolution (LTE) communication protocols, or anycombination thereof.

Although the present disclosure describes the calibration andimplementation phases being executed in association with the samevehicle (e.g., the vehicle 102), it will be apparent to a person skilledin the art that the scope of the disclosure is not limited to the samevehicle for executing the calibration and implementation phases. Invarious other embodiments, the calibration and implementation phases maybe executed for two separate vehicles (such as a first vehicle and asecond vehicle). In such a scenario, to ensure accuracy of the distanceprediction, a position of an image-capturing device (such as theimage-capturing device 106 or the image-capturing device 112) on thefirst vehicle in the calibration phase is the same as a position ofanother image-capturing device on the second vehicle in theimplementation phase. Further, specification of the image-capturingdevices used with the first vehicle and the second vehicle may be thesame. Further, various dimensions of the first vehicle and the secondvehicle may be similar. Various operations associated with thecalibration of fixed image-capturing devices of vehicles for depthestimation have been described in detail in conjunction with FIGS. 2A,2B, 3A, and 3B.

FIG. 2A illustrates an inside view of the vehicle 102, in accordancewith an exemplary embodiment of the disclosure. The vehicle 102 mayinclude the vehicle device 104 that is installed on a front windshield200 of the vehicle 102. The vehicle device 104 may include theimage-capturing device 106, the processor 108, and the memory 110 thatare communicatively connected to each other via the first communicationbus. Also, the vehicle device 104 may be communicatively connected tothe application server 120 via the communication network 124. In anembodiment, the image-capturing device 106 is positioned perpendicularto the ground plane to ensure that sizes and distances of the variousobjects (such as the first object) captured by the image-capturingdevice 106 are not distorted.

It will be apparent to a person skilled in the art that the scope of thedisclosure is not limited to the installation of the vehicle device 104as shown in FIG. 2A. In various other embodiments, the position of thevehicle device 104 in the vehicle 102 may vary. However, the position ofthe image-capturing device 106 in the vehicle 102 may remain intact withrespect to the calibration phase and the implementation phase. Forexample, if the position of the image-capturing device 106 installedwith the vehicle 102 is defined by x₁, y₁, and z₁ coordinates in thecalibration phase, then the position of the image-capturing device 106installed with the vehicle 102 may be defined by the same x₁, y₁, and z₁coordinates in the implementation phase. The x₁, y₁, and z₁ coordinatesmay be defined with respect to a fixed point on the vehicle 102.

FIG. 2B illustrates an inside view of the vehicle 102, in accordancewith another exemplary embodiment of the disclosure. The vehicle 102 mayinclude the image-capturing device 112 that is installed on the frontwindshield 200 of the vehicle 102. The vehicle 102 may further includethe vehicle device 114 that is installed on a dashboard 202 of thevehicle 102. The vehicle device 114 may include the processor 116 andthe memory 118 that are communicatively connected to each other via thethird communication bus. The image-capturing device 112 may becommunicatively connected to the vehicle device 114 via thecommunication network 124 or the second communication bus. Also, theimage-capturing device 112 and the vehicle device 114 may becommunicatively connected to the application server 120 via thecommunication network 124. In an embodiment, the image-capturing device112 is positioned perpendicular to the ground plane to ensure that sizesand distances of the various objects captured by the image-capturingdevice 112 are not distorted.

It will be apparent to a person skilled in the art that the scope of thedisclosure is not limited to the installation of the image-capturingdevice 112 and the vehicle device 114 as shown in FIG. 2B. In variousother embodiments, the positions of the image-capturing device 112 andthe vehicle device 114 in the vehicle 102 may vary. However, theposition of the image-capturing device 112 in the vehicle 102 may remainintact with respect to the calibration phase and the implementationphase. For example, if the position of the image-capturing device 112installed with the vehicle 102 is defined by x₂, y₂, and z₂ coordinatesin the calibration phase, then the position of the image-capturingdevice 112 installed with the vehicle 102 may be defined by the same x₂,y₂, and z₂ coordinates in the implementation phase. The x₂, y₂, and z₂coordinates may be defined with respect to a fixed point on the vehicle102.

FIG. 3A illustrates the calibration system 300 for calibrating theimage-capturing device 106 of the vehicle 102, in accordance with anexemplary embodiment of the disclosure. The calibration system 300 mayinclude the vehicle 102 and the carpet 302 having the first and secondcalibration lines c₁ and c₂. The first and second calibration lines c₁and c₂ may be associated with the same known width W and may be at theknown distance d from each other. In an embodiment, the second distanceof the first calibration line c₁ from the vehicle 102 is illustrated inthe FIG. 3A as “x” (hereafter referred to as, “the second distance x”).Further, the third distance of the second calibration line c₂ from thevehicle 102 is illustrated in the FIG. 3B as “y” (hereafter referred toas, “the third distance y”), where y=d+x. Further, the first and secondcalibration lines c₁ and c₂ may be parallel to each other andperpendicular to the path of the vehicle 102. In an embodiment, thevehicle device 104 may be installed on the front windshield 200 of thevehicle 102 such that the image-capturing device 106 may be at thecenter of the front windshield 200. In another embodiment, theimage-capturing device 112 may be installed at the center of the frontwindshield 200 for capturing the first image of the calibration system300. For the sake of ongoing description, it is assumed that the vehicledevice 104 is installed on the front windshield 200. Further, thevehicle 102 is moving on the carpet 302, and the image-capturing device106 may be configured to capture the first image of the calibrationsystem 300.

FIG. 3B illustrates the first image 304 captured by the image-capturingdevice 106, in accordance with an exemplary embodiment of thedisclosure. The first image 304 may include the first and secondcalibration lines c₁ and c₂. In an exemplary embodiment, one or morepoints on the carpet 302 (that lie at a distance from the vehicle 102)may be observed at the same distance (i.e., height) in the first image304. In other words, the one or more points associated with the firstcalibration line c₁ painted on the carpet 302 at the second distance xfrom the vehicle 102 may be observed in the first image 304 along thesame row of pixels (i.e., the first row of pixels r₁). Similarly, theone or more points associated with the second calibration line c₂painted on the carpet 302 at the third distance y from the vehicle 102may be observed in the first image 304 along the same row of pixels(i.e., the second row of pixels r₂). Thus, the first and second rows ofpixels r₁ and r₂ may be at the second and third distances x and y fromthe vehicle 102, respectively.

As illustrated in FIG. 3A, the second distance x is less than the thirddistance y. Hence, the first observed width w₁ (i.e., the width of thefirst calibration line c₁ as observed in the first image 304) is greaterthan the second observed width w₂ (i.e., the width of the secondcalibration line c₂ as observed in the first image 304) even though thefirst and second calibration lines c₁ and c₂ may have the same width(i.e., the known width W) on the carpet 302. The difference in the firstand second observed widths w₁ and w₂ may be represented by δ_(w).Further, when the first and second calibration lines c₁ and c₂ arecentered with respect to an axis passing through the center of theimage-capturing device 106, the difference in the first and secondobserved widths w₁ and w₂ may be symmetric on both sides of the axis(illustrated as δ_(w)/2 in the first image 304 of FIG. 3B).

It will be apparent to a person having ordinary skill in the art thatvertical edges of the carpet 302 (that are straight lines in thecalibration system 300) may be observed as tilted lines in the firstimage 304 due to perspective distortion. In other words, the carpet 302with a rectangular shape may be observed as a trapezoid in the firstimage 304. The distance between the first and second rows of pixels(illustrated by h in the first image 304) may correspond to the heightof the trapezoid. An angle θ may be the first angle between the firstcalibration line c₁ and a first line joining the end points of the firstand second calibration lines c₁ and c₂, as shown in FIG. 3B. Similarly,an angle α may be a second angle between the first calibration line c₁and a second line joining the end points of the first and secondcalibration lines c₁ and c₂. The first and second lines may correspondto two non-parallel sides of the trapezoid and the angles θ and α maycorrespond to base angles of the trapezoid. When the first and secondcalibration lines c₁ and c₂ are centered with respect to the axis of theimage-capturing device 106, lengths of the first and second lines may beequal and the angle θ may be equal to the angle α. In other words, thecarpet 302 may be observed as an isosceles trapezoid in the first image304.

In operation, the distance prediction mechanism associated with thevehicle 102 may be calibrated in the calibration phase to predict thefirst distance of the first object captured in front of the vehicle 102in the implementation phase. For the sake of ongoing description, it isassumed that the distance prediction mechanism may be realized andimplemented by utilizing the vehicle device 104 that is installed withthe vehicle 102. The vehicle device 104 may include the image-capturingdevice 106, the processor 108, and the memory 110. However, it will beapparent to a person skilled in the art that the scope of the disclosureis not limited to the realization and implementation of the distanceprediction mechanism by utilizing the vehicle device 104. In variousother embodiments, the distance prediction mechanism may be realized andimplemented by utilizing the image-capturing device 112 and the vehicledevice 114, the image-capturing device 112, the application server 120,and the database server 122, or any combination thereof.

In the calibration phase, the vehicle device 104 may be calibrated byutilizing the calibration system 300. The calibration system 300 mayinclude the first and second calibration lines c₁ and c₂ on the carpet302 such that the first and second calibration lines c₁ and c₂ may havethe same width (i.e., the known width W) that is equal to a width of thecarpet 302. Further, the first calibration line c₁ may be drawn at theknown distance d from the second calibration line c₂. The first andsecond calibration lines c₁ and c₂ may be parallel to each other andperpendicular to the path of the vehicle 102. In an embodiment, duringexecution of calibration processes of the calibration phase, the vehicle102 is traversing along the carpet 302, and the image-capturing device106 may be configured to capture the first image 304 of the calibrationsystem 300. The first image 304 illustrates the first and secondcalibration lines c₁ and c₂ having the first and second observed widthsw₁ and w₂, respectively. Upon capturing the first image 304, theimage-capturing device 106 may be configured to transmit the first image304 to the processor 108. In an embodiment, a color model associatedwith the first image 304 is the RGB color model.

In an embodiment, the processor 108 may be configured to receive thefirst image 304 from the image-capturing device 106 and process thefirst image 304 to identify the first plurality of rows of pixels (suchas the first and second rows of pixels r₁ and r₂) in the first image304. The first and second rows of pixels r₁ and r₂ may correspond to thefirst and second calibration lines c₁ and c₂, respectively. In anembodiment, the processor 108 may be configured to identify the firstand second rows of pixels r₁ and r₂ based on one or more inputs providedby the administrator utilizing one or more input/output ports (notshown) of the vehicle device 104. In another embodiment, the processor108 may be configured to convert the first image 304 from the RGB colormodel to another color model such as the HSV color model. Thereafter,the processor 108 may be further configured to filter the convertedfirst image (not shown) to obtain a known color of the carpet 302, andfurther process the filtered first image (shown in FIGS. 4B and 4C) toidentify the first and second rows of pixels r₁ and r₂. In anotherembodiment, the first and second rows of pixels r₁ and r₂ may also beidentified by utilizing a crowdsourcing platform where other users(e.g., crowd workers) may take up the related tasks, identify the firstand second rows of pixels r₁ and r₂, and upload the identified first andsecond rows of pixels r₁ and r₂ onto the crowdsourcing platform in anonline manner. The afore-mentioned method for identifying the first andsecond rows of pixels r₁ and r₂ has been described in detail inconjunction with FIGS. 4A-4C.

Further, in an embodiment, the processor 108 may be configured toestimate the focal length of the image-capturing device 106 based on oneof the first calibration line c₁ or the second calibration line c₂.Further, it is apparent to a person skilled in the art that the focallength F may be estimated by utilizing a first equation (1) as shownbelow:

$\begin{matrix}{F = \frac{w_{k}*d_{k}}{W}} & (1)\end{matrix}$

Further, the first equation (1) may be modified to a second equation (2)as shown below:F*W=w _(k) *d _(k)  (2)

In the estimation of the focal length F based on the first calibrationline c₁, w_(k) indicates the first observed width w₁, d_(k) indicatesthe second distance x, and W indicates the known width of the firstcalibration line c₁. Thus, the second equation (2) may be modified to athird equation (3) as shown below:F*W=w ₁ *x  (3)

Similarly, in the estimation of the focal length F based on the secondcalibration line c₂, w_(k) indicates the second observed width w₂, d_(k)indicates the third distance y, and W indicates the known width of thesecond calibration line c₂. Thus, the second equation (2) may bemodified to a fourth equation (4) as shown below:F*W=w ₂ *y  (4)

As the first and second calibration lines c₁ and c₂ may be associatedwith equal known widths W and the focal length F may be a constant valuefor the image-capturing device 106, the left-hand sides (LHSs) of thethird equation (3) and the fourth equation (4) are equal. Hence, basedon the third equation (3) and the fourth equation (4), a fifth equation(5) may be obtained that is shown below:w ₁ *x=w ₂ *y  (5)where, y=d+x

Further, the fifth equation (5) may be modified to obtain a sixthequation (6) as shown below:

$\begin{matrix}{x = \frac{d*w_{2}}{\left( {w_{1} - w_{2}} \right)}} & (6)\end{matrix}$

Thus, the processor 108 may be configured to estimate the seconddistance x based on the known distance d, the first observed width w₁,and the second observed w₂. Similarly, the processor 108 may beconfigured to estimate the third distance y based on the second distancex and the known distance d. Further, in an embodiment, the processor 108may be configured to estimate the focal length of the image-capturingdevice 106 based on the first equation (1).

Further, as illustrated in FIG. 3B, the first observed width w₁ may begreater than the second observed width w₂ since the second distance x isless than third distance y. The difference between the first and secondobserved widths w₁ and w₂ may be represented by δ_(w). Since the firstand second calibration lines c₁ and c₂ are centered with respect to theaxis of the image-capturing device 106, the difference δ_(w) may besymmetric. Thus, δ_(w)/2 may be estimated by utilizing a seventhequation (7) as shown below:

$\begin{matrix}{\frac{\delta_{w}}{2} = {h*\cot\;\theta}} & (7)\end{matrix}$where,h indicates the second distance between the first and second rows ofpixels (r₂−r₁), and θ indicates the angle of the isosceles trapezoid.

Thus, the difference δ_(w) may be estimated by utilizing an eighthequation (8) as shown below:δ₂=2*h*cot θ  (8)

In an embodiment, for one or more rows of pixels above the first row ofpixels r₁, a width of a corresponding line may be reduced. Thus, for athird line (not shown) corresponding to a fifth row of pixels r₅ that isbetween the first and second rows of pixels r₁ and r₂ in the first image304, a width of the third line may be less than the first observed widthw₁ and more than the second observed width w₂. Hence, the width of thethird line (hereinafter, “the third width”) may be estimated based on achange in width δ_(w)′ of the third line with respect to either thefirst calibration line c₁ or the second calibration line c₂. Forexample, the third width w₃ of the third line with respect to the firstcalibration line c₁ may be estimated by utilizing a ninth equation (9)as shown below:w ₃ =w ₁−δ_(w)′  (9)where, δ_(w)′=2*(r₅−r₁)*cot θ.

Similarly, a width of a line corresponding to an “i^(th)” row of pixelsr_(i) above the first row of pixels r₁ may be estimated by utilizing atenth equation (10) as shown below:w _(i) =w ₁−2*(r _(i) −r ₁)*cot θ  (10)where, (r_(i)−r₁) indicates the second distance between the “i^(th)” rowof pixels r_(i) and the first row of pixels r₁.

In an embodiment, for one or more rows of pixels below the first row ofpixels, a width of a corresponding line may be increased. Hence, a widthof a line corresponding to a “j^(th)” row of pixels r_(j) below thefirst row of pixels r₁ may be estimated by utilizing an eleventhequation (11) as shown below:w _(j) =w ₁+2*(r ₁ −r _(j))*cot θ  (11)where, (r₁−r_(j)) indicates the second distance between the first row ofpixels r₁ and the “j^(th)” row of pixels r_(j).

Similarly, for one or more rows of pixels below the second row of pixelsr₂, a width of a corresponding line may be increased. Hence, the thirdwidth w₃ with respect to the second calibration line c₂ may be estimatedby utilizing a twelfth equation (12) as shown below:w ₃ =w ₂+δ_(w)′  (12)

Similarly, a width of a line corresponding to a “p^(th)” row of pixelsr_(p) below the second row of pixels r₂ may be estimated by utilizing athirteenth equation (13) as shown below:w _(p) =w ₂+2*(r ₂ −r _(p))*cot θ  (13)where, (r₂−r_(p)) indicates the second distance between the second rowof pixels r₂ and the “p^(th)” row of pixels r_(p).

Further, for one or more rows of pixels above the second row of pixelsr₂, a width of a corresponding line may be reduced. Hence, a width of aline corresponding to a “q^(th)” row of pixels r_(q) above the secondrow of pixels r₂ may be estimated by utilizing a fourteenth equation(14) as shown below:w _(q) =w ₂−2*(r _(q) −r ₂)*cot θ  (14)where, (r_(q)−r₂) indicates the second distance between the “q^(th)” rowof pixels r_(q) and the second row of pixels r₂.

Thus, for each of the remaining rows of pixels (i.e., the secondplurality of rows of pixels) in the first image 304, the processor 108may be configured to estimate the width of the corresponding line. In anembodiment, the processor 108 may be further configured to estimate thefifth distance of a line corresponding to each remaining row of pixelsfrom the vehicle 102 based on the corresponding estimated width, theknown width W, and the focal length F. For example, the fifth distanceds of a line corresponding to an “s^(th)” row of pixels r_(s) of theremaining rows of pixels from the vehicle 102 may be estimated byutilizing a fifteenth equation (15) as shown below:

$\begin{matrix}{d_{s} = \frac{W*F}{w_{s}}} & (15)\end{matrix}$where,w_(s) indicates the estimated width of a line corresponding to the“s^(th)” row of pixels r_(s).

In an embodiment, based on the estimated distances, the processor 108may be configured to store the second and third distances x and yassociated with the first and second rows of pixels r₁ and r₂,respectively, and the fifth distance associated with each remaining rowof pixels as the distance data set in the memory 110. In anotherembodiment, the processor 108 may be configured to store the distancedata set in the database server 122. The vehicle device 104 may utilizethe distance data set to predict the first distance of the first objectin the implementation phase i.e., in the real-time driving scenarios.

In the implementation phase, when the vehicle 102 is traversing theroad, the image-capturing device 106 may be configured to continuouslycapture the one or more images of the various objects that are presentin front of the vehicle 102. For example, the image-capturing device 106may capture the second image of the first object on the road andtransmit the second image to the processor 108.

The processor 108 may be configured to receive the second image from theimage-capturing device 106 and process the second image to detect thefirst object in the second image. The processor 108 may be furtherconfigured to detect the first bottom edge of the first object in thesecond image. In an embodiment, the processor 108 may perform an objectdetection operation on the second image to detect the first object inthe second image. Examples of the object detection may include a Haarbased object detection, a histogram of oriented gradients (HOG) basedobject detection, an HOG and support vector machines (SVM), i.e., theHOG-SVM based object detection, deep learning based object detection(using a convolutional neural network (CNN) approach, aregion-of-interest-CNN i.e., an R-CNN approach, a fast R-CNN approach,or a faster R-CNN approach), or any combination thereof. The objectdetection operation may output a first rectangular bounding-box (shownin FIGS. 5A and 5B) that may include the first object in the secondimage. The first bottom edge of the first rectangular bounding-box mayindicate a line of contact of the first object with the ground planei.e., the first bottom edge of the first rectangular bounding-box maylie on the ground plane, as viewed from the image-capturing device 106.

Upon detection of the first bottom edge, the processor 108 may beconfigured to identify the third row of pixels in the second imageassociated with the first bottom edge. In an embodiment, based on thethird row of pixels, the processor 108 may be configured to retrieve thefirst distance value from the memory 110. In another embodiment, basedon the third row of pixels, the processor 108 may transmit the query tothe database server 122 to retrieve the first distance value. The firstdistance value may correspond to the fourth row of pixels in the firstimage 304 having the row number that is equal to the row number of thethird row of pixels in the second image. Further, the processor 108 maypredict the first distance of the first object from the vehicle 102based on the first distance value. In an embodiment, the first distancemay be a distance of the first object from the image-capturing device106. A distance of the first object from a front edge of the vehicle 102may be determined based on at least the first distance and a length ofbonnet of the vehicle 102.

Further, the processor 108 may be configured to generate the warningmessage based on the first distance of the first object and communicatethe warning message to the driver of the vehicle 102. For example, ifthe first distance is less than the threshold value, the processor 108may generate the warning message indicating the impending collision ofthe vehicle 102 with the first object, and communicate the warningmessage to the driver for offering the driving assistance in real-timethat may help to prevent the impending collision. In some embodiments,the processor 108 may generate the warning message based on the firstdistance and speed of the vehicle 102. The processor 108 may communicatethe warning message to the driver by communicating an SMS, an audiomessage, a video message, a haptic message, or the like.

In some embodiments, other than the first object, the first image mayinclude various other objects. Distances of the various other objectscaptured in the second image may be predicted by executing a processthat is similar to the process for predicting the first distance of thefirst object from the vehicle 102. Further, although the disclosuredescribes use of a single image-capturing device (e.g., theimage-capturing device 106) it will be apparent to a person skilled inthe art that the scope of the disclosure is not limited to the use ofthe single image-capturing device. In some embodiments, a plurality ofimage-capturing devices having same or different focal lengths may beutilized.

Although the disclosure describes the prediction of distances of thevarious objects in front of the vehicle 102, it will be apparent to aperson skilled in the art that the scope of the disclosure is notlimited to the prediction of distances of the various objects that arein the front of the vehicle 102. In some embodiments, distances ofvarious objects (that are behind or sideways to the vehicle 102) mayalso be predicted in the similar manner as described above. Forpredicting the distances of the various objects (that are behind thevehicle 102), a rear image-capturing device (not shown) may be installedon a rear side of the vehicle 102. Similarly, for predicting thedistances of the various objects (that are sideways to the vehicle 102),one or more sideway image-capturing devices (not shown) may be installedon each side of the vehicle 102.

FIGS. 4A-4C, collectively, illustrate identification of the first andsecond rows of pixels r₁ and r₂ corresponding to the first and secondcalibration lines c₁ and c₂, respectively, in accordance with anexemplary embodiment of the disclosure. As illustrated in FIG. 4A, theimage-capturing device 106 installed on the front windshield 200 may beconfigured to capture the first image 304 of the calibration system 300.The image-capturing device 106 may be further configured to transmit thefirst image 304 to the processor 108. The first image 304 may includethe carpet 302 and the first and second calibration lines c₁ and c₂drawn on the carpet 302. The first and second calibration lines c₁ andc₂ may be at the second distance x and the third distance y,respectively, from the vehicle 102. As illustrated in FIG. 4A, the firstand second calibration lines c₁ and c₂ may divide the carpet 302 into aplurality of sections such as sections 402 a-402 c. For simplicity ofthe ongoing discussion, a color of the carpet 302 used in thecalibration system has been assumed as green color.

Further, the color model associated with the first image 304 may be theRGB color model. However, the separation of color (i.e., separation ofthe green color of the carpet 302 from other colors in the first image304) may be more distinct in the HSV color model as compared to the RGBcolor model. Thus, the processor 108 may be configured to convert thefirst image 304 from the RGB color model into the HSV color model. Theprocessor 108 may be further configured to filter the converted firstimage to distinctly obtain the green color sections (i.e., the sections402 a-402 c) in the converted first image. The sections 402 a-402 c ofgreen color in the first image 304 have been illustrated as sections 404a-404 c of black color in the filtered first image 406 (as illustratedin FIG. 4B). Further, the filtered first image 406 may include a section408 a (between the sections 404 a and 404 b) and a section 408 b(between the sections 404 b and 404 c). The sections 408 a and 408 b maybe indicative of the first and second calibration lines c₁ and c₂,respectively.

The processor 108 may be further configured to perform an edge detectionoperation on the filtered first image 406 to identify a set of lines 410a passing through the section 408 a and a set of lines 410 b passingthrough the section 408 b. The sets of lines 410 a and 410 b areillustrated in FIG. 4C. The sets of lines 410 a and 410 b may becandidate lines for the first and second calibration lines c₁ and c₂,respectively. The processor 108 may be further configured to perform aHough transform operation on the filtered first image 406 to identifyfirst and second reference lines from the sets of lines 410 a and 410 bthat correspond to the first and second calibration lines c₁ and c₂,respectively. In an example, the first and second reference lines may beidentified from the sets of lines 410 a and 410 b, respectively, basedon a slope of each line. The processor 108 may identify the first andsecond rows of pixels r₁ and r₂ based on the first and second referencelines, respectively. In an example, the processor 108 may identify thefirst and second rows of pixels r₁ and r₂ based on coordinates of thefirst and second reference lines, respectively.

FIG. 5A illustrates the second image 500 including objects captured bythe image-capturing device 106, in accordance with an exemplaryembodiment of the disclosure. The second image 500 may include objects502 a-502 d present on the road in front of the vehicle 102. Forexample, the objects 502 a and 502 b are cars, the object 502 c is atruck, and the object 504 d is a bike. In an embodiment, the object 502a is the first object. In another embodiment, the object 502 b is thefirst object. In another embodiment, the object 502 c is the firstobject. In another embodiment, the object 502 d is the first object. Thesecond image 500 may further include rectangular bounding-boxes 504a-504 d around the borders of the objects 502 a-502 d indicating likelypositions of the objects 502 a-502 d in the second image 500,respectively. The rectangular bounding-boxes 504 a-504 d may be obtainedas a result of the object detection operation performed by the processor108 on the second image 500. Examples of the object detection mayinclude a Haar based object detection, a histogram of oriented gradients(HOG) based object detection, an HOG and support vector machines (SVM)i.e., the HOG-SVM based object detection, deep learning based objectdetection (using a convolutional neural network (CNN) approach, aregion-of-interest-CNN, i.e., an R-CNN approach, a fast R-CNN approach,or a faster R-CNN approach), or any combination thereof.

FIG. 5B illustrates the predicted distances of the objects 502 a-504 dfrom the vehicle 102, in accordance with an exemplary embodiment of thedisclosure. As illustrated in FIG. 5B, the object 502 a is at a distanceof 9 m from the vehicle 102, the object 502 b is at a distance of 7 mfrom the vehicle 102, the object 502 c is at a distance of 11 m from thevehicle 102, and the object 502 d is at a distance of 8.5 m from thevehicle 102. The predicted distance (i.e., the first distance) of eachobject in front of the vehicle 102 may be presented to the driver of thevehicle 102. Further, based on at least the predicted distance of eachobject, the warning message may be generated and communicated to thedriver. For example, if the predicted distances of any of the objects502 a-502 d (such as the object 502 a) is less than the threshold value,then a time to collision of the vehicle 102 with the object 502 a may bedetermined. The time to collision may be determined based on thepredicted distance and a relative speed between the vehicle 102 and theobject 502 a. Based on the determined time to collision, the warningmessage indicating the impending collision may be generated andcommunicated to the driver of the vehicle 102. The warning message maybe communicated in the form of a text message, an audio signal, a videosignal, or the like. In an embodiment, the predicted distance of eachobject may indicate a distance between the bottom edge of thecorresponding object and the front end of the vehicle 102. In anotherembodiment, the predicted distance of each object may indicate adistance between the bottom edge of the corresponding object and theimage-capturing device 106 of the vehicle device 104 installed in thevehicle 102.

FIGS. 6A and 6B illustrate a flow chart 600 of a method for predictingthe first distance of the first object from the vehicle 102, inaccordance with an exemplary embodiment of the disclosure. The distanceprediction mechanism may detect a presence of the first object in frontof the moving vehicle (e.g., the vehicle 102) and may predict thedistance of the first object from the moving vehicle. In an embodiment,the distance prediction mechanism may be the vehicle device 104 thatincludes the image-capturing device 106, the processor 108, and thememory 110. The vehicle device 104 may be calibrated in the calibrationphase to predict the first distance in the implementation phase. Thevehicle device 104 may be calibrated by way of the calibration system300 that may include the first and second calibration lines c₁ and c₂drawn on the carpet 302 at the known distance d from each other.

At 602, the first image 304 of the calibration system is captured. In anembodiment, the image-capturing device 106 may be configured to capturethe first image 304. The first image 304 may include the first andsecond calibration lines c₁ and c₂. The image-capturing device 106 maybe configured to transmit the first image 304 (i.e., image dataassociated with the first image 304) to the processor 108.

At 604, the first and second rows of pixels r₁ and r₂ corresponding tothe first and second calibration lines c₁ and c₂, respectively, areidentified in the first image 304. In an embodiment, the processor 108may be configured to identify the first and second rows of pixels r₁ andr₂ based on the first image 304.

At 606, the second distance x and the third distance y of the first andsecond calibration lines c₁ and c₂, respectively, from the vehicle 102is estimated. In an embodiment, the processor 108 may be configured toestimate the second distance x and the third distance y of the first andsecond calibration lines c₁ and c₂, respectively, from the vehicle 102based on the known distance d, the first observed width w₁, and thesecond observed width w₂.

At 608, the focal length F of the image-capturing device 106 isestimated. In an embodiment, the processor 108 may be configured toestimate the focal length F of the image-capturing device 106 based onat least the first calibration line c₁ or the second calibration c₂. Forexample, the processor 108 may estimate the focal length F of theimage-capturing device 106 based on the second distance x and the knownwidth W of the first calibration line c₁, and the first observed widthw₁.

At 610, the width of the line corresponding to each remaining row ofpixels in the first image 304 is estimated. In an embodiment, theprocessor 108 may be configured to estimate, for each remaining row ofpixels in the first image 304, the width of the corresponding line basedon the fourth distance between the corresponding row of pixels and thefirst or the second row of pixels r₁ or r₂, the first and secondobserved widths w₁ and w₂, and the first angle θ. The remaining rows ofpixels in the first image 304 may correspond to the rows of pixels inthe first image 304 apart from the first and second rows of pixels r₁and r₂.

At 612, the fifth distance of a line corresponding to each remaining rowof pixels in the first image 304 from the vehicle 102 is estimated. Inan embodiment, the processor 108 may be configured to estimate the fifthdistance of a line corresponding to each remaining row of pixels in thefirst image 304 from the vehicle 102 based on the known width W, theestimated width of the corresponding line, and the focal length F. Thus,each row of pixels in the first image 304 may have a correspondingdistance from the vehicle 102 associated with it.

At 614, the distance data set is stored in the memory 110 or thedatabase server 122. In an embodiment, the processor 108 may beconfigured to store the distance data set in the memory 110 or thedatabase server 122. The distance data set may include the second andthird distances x and y associated with the first and second rows ofpixels in the first image 304 and the estimated distance associated witheach remaining row of pixels in the first image 304. Thus, the vehicledevice 104 may be calibrated to predict distances of the various objectsbased on distance values included in the distance data set that may bestored in the memory 110 or the database server 122.

The implementation phase of the disclosure may correspond to the vehicle102 traversing the road. At 616, the second image 500 of the firstobject (e.g., the objects 502 a-502 d) present on the road in front ofthe vehicle 102 is captured. In an embodiment, the image-capturingdevice 106 may be configured to capture the second image 500, as thevehicle 102 traverses the road, and transmit the second image 500 (i.e.,image data associated with the second image 500) to the processor 108.The second image 500 includes the first object (e.g., the objects 502a-502 d).

At 618, the first bottom edge of the first object is detected in thesecond image 500. In an embodiment, the processor 108 may be configuredto detect the first bottom edge of the first object based on the secondimage 500. At 620, the third row of pixels in the second image 500corresponding to the first bottom edge is identified. In an embodiment,the processor 108 may be configured to identify the third row of pixelsin the second image 500 corresponding to the first bottom edge. At 622,the first distance value from the memory 110 or the database server 122is retrieved. In an embodiment, the processor 108 may be configured toretrieve the first distance value from the memory 110 based on the thirdrow of pixels. In another embodiment, based on the third row of pixels,the processor 108 may be configured to transmit the query to thedatabase server 122 to retrieve the first distance value. The firstdistance value may correspond to the fourth row of pixels in the firstimage 304 whose row number is equal to the row number of the third rowof pixels in the second image 500.

At 624, the first distance of the first object from the vehicle 102 ispredicted. In an embodiment, the processor 108 may be configured topredict the first distance of the first object from the vehicle 102based on the retrieved first distance value. At 626, the warning messageis generated. In an embodiment, the processor 108 may be configured togenerate the warning message based on the predicted first distance. Forexample, the processor 108 may generate the warning message when thefirst distance is less than the threshold value. At 628, the warningmessage is communicated to the driver of the vehicle 102. In anembodiment, the processor 108 may be configured to communicate thewarning message to the driver of the vehicle 102 indicating theimpending collision.

FIG. 6C illustrates a flowchart 630 of a method for identifying thefirst and second rows of pixels r₁ and r₂ corresponding to the first andsecond calibration lines c₁ and c₂, respectively, in accordance with anexemplary embodiment of the disclosure. The processor 108 may beconfigured to receive the first image 304 of the calibration system 300including the first and second calibration lines c₁ and c₂ from theimage-capturing device 106. The color model associated with the firstimage 304 is the RGB color model. However, the separation of color(e.g., the green color of the carpet 302) is more distinct in the HSVcolor model as compared to the RGB color model.

At 632, the first image 304 is converted from the RGB color model to theHSV color model. In an embodiment, the processor 108 may be configuredto convert the first image 304 from the RGB color model to the HSV colormodel. At 634, the converted first image is filtered to obtain the greencolor associated with the carpet 302. In an embodiment, the processor108 may be configured to filter the converted first image to obtain thegreen color associated with the carpet 302 of the calibration system300. At 636, the first and second rows of pixels r₁ and r₂ correspondingto the first and second calibration lines c₁ and c₂, respectively, areidentified from the filtered first image 406. In an embodiment, theprocessor 108 may be configured to identify the first and second rows ofpixels r₁ and r₂ corresponding to the first and second calibration linesc₁ and c₂, respectively, from the filtered first image 406.

FIG. 7 is a block diagram that illustrates a computer system 700 forcalibrating a fixed image-capturing device (such as the image-capturingdevice 106 or 112) of a vehicle (such as the vehicle 102) and predictinga distance of an object (such as the first object) from the vehicle, inaccordance with an exemplary embodiment of the disclosure. An embodimentof the disclosure, or portions thereof, may be implemented as computerreadable code on the computer system 700. In one example, the vehicledevice 104, the vehicle device 114, the application server 120, and thedatabase server 122 of FIG. 1 may be implemented in the computer system700 using hardware, software, firmware, non-transitory computer readablemedia having instructions stored thereon, or a combination thereof andmay be implemented in one or more computer systems or other processingsystems. Hardware, software, or any combination thereof may embodymodules and components used to implement the methods of FIGS. 6A-6C.

The computer system 700 may include a processor 702 that may be aspecial purpose or a general-purpose processing device. The processor702 may be a single processor, multiple processors, or combinationsthereof. The processor 702 may have one or more processor “cores.”Further, the processor 702 may be connected to a communicationinfrastructure 704, such as a bus, a bridge, a message queue, multi-coremessage-passing scheme, the communication network 124, or the like. Thecomputer system 700 may further include a main memory 706 and asecondary memory 708. Examples of the main memory 706 may include RAM,ROM, and the like. The secondary memory 708 may include a hard diskdrive or a removable storage drive (not shown), such as a floppy diskdrive, a magnetic tape drive, a compact disc, an optical disk drive, aflash memory, or the like. Further, the removable storage drive may readfrom and/or write to a removable storage device in a manner known in theart. In an embodiment, the removable storage unit may be anon-transitory computer readable recording media.

The computer system 700 may further include an input/output (I/O) port710 and a communication interface 712. The I/O port 710 may includevarious input and output devices that are configured to communicate withthe processor 702. Examples of the input devices may include a keyboard,a mouse, a joystick, a touchscreen, a microphone, and the like. Examplesof the output devices may include a display screen, a speaker,headphones, and the like. The communication interface 712 may beconfigured to allow data to be transferred between the computer system700 and various devices that are communicatively coupled to the computersystem 700. Examples of the communication interface 712 may include amodem, a network interface, i.e., an Ethernet card, a communicationport, and the like. Data transferred via the communication interface 712may be signals, such as electronic, electromagnetic, optical, or othersignals as will be apparent to a person skilled in the art. The signalsmay travel via a communications channel, such as the communicationnetwork 124, which may be configured to transmit the signals to thevarious devices that are communicatively coupled to the computer system700. Examples of the communication channel may include a wired,wireless, and/or optical medium such as cable, fiber optics, a phoneline, a cellular phone link, a radio frequency link, and the like. Themain memory 706 and the secondary memory 708 may refer to non-transitorycomputer readable mediums that may provide data that enables thecomputer system 700 to implement the methods illustrated in FIGS. 6A-6C.

Various embodiments of the disclosure provide the vehicle device 104 forcalibrating the fixed image-capturing device (such as theimage-capturing device 106) of the vehicle 102. The vehicle device 104may be configured to identify the first plurality of rows of pixels(such as the first and second rows of pixels r₁ and r₂) in the firstimage 304. The first image 304 may be captured by the image-capturingdevice 106. The first image 304 may include the plurality of calibrationlines (such as the first and second calibration lines c₁ and c₂). Thefirst calibration line c₁ of the plurality of lines is at the knowndistance d from the second calibration line c₂ of the plurality oflines. The first plurality of rows of pixels may correspond to theplurality of calibration lines. The vehicle device 104 may be furtherconfigured to estimate the second distance x and the third distance y ofthe first and second calibration lines c₁ and c₂, respectively, from theimage-capturing device 106. The second distance x and the third distancey are estimated based on at least the known distance d, the firstobserved width w₁, and the second observed width w₂. The vehicle device104 may be further configured to estimate the focal length F of theimage-capturing device 106. The focal length F may be estimated based onat least the first calibration line c₁ or the second calibration linec₂. The vehicle device 104 may be further configured to estimate thefifth distance of each row of pixels of the second plurality of rows ofpixels in the first image 304 from the image-capturing device 106. Thefifth distance may be estimated based on at least the focal length F andthe width (such as the third width w₃) of the line (such as the thirdline) corresponding to each row of pixels. The third width w₃ may beestimated based on at least the plurality of calibration lines and eachrow of pixels of the second plurality of rows of pixels. The firstplurality of rows of pixels and the second plurality of rows of pixelsmay constitute the first image. The vehicle device 104 may be furtherconfigured to store the distance data set including at least the seconddistance x, the third distance y, and the fifth distance in a memory(such as the memory 110). Further, a distance of an object from anotherobject may be predicted based on the stored distance data set and animage of the object.

Various embodiments of the disclosure provide the vehicle device 104 forpredicting the first distance of the first object from the vehicle 102.In an embodiment, the image-capturing device 106 of the vehicle device104 may be configured to capture the image (such as the second image500) of the first object. The processor 108 of the vehicle device 104may be configured to detect the first bottom edge of the first objectbased on the second image. The processor 108 may be further configuredto identify the row of pixels (such as the third row of pixels) in thesecond image 500 corresponding to the detected bottom edge. Theprocessor 108 may be further configured to predict the first distance ofthe first object from the vehicle 102 based on a distance valueretrieved from the distance data set that may be stored in the memory110 of the vehicle device 104 or a separate memory device installed inthe vehicle 102. The distance value may be retrieved from the distancedata set based on at least the third row of pixels. The distance dataset may be estimated by executing one or more calibration operations.For example, the plurality of rows of pixels (such as first plurality ofrows of pixels) in the image (such as the first image 304) including theplurality of calibration lines may be identified. The first plurality ofrows of pixels may correspond to the plurality of calibration lines. Thefirst calibration line c₁ of the plurality of calibration lines is theknown distance d from the second calibration line c₂ of the plurality ofcalibration lines. Further, the second distance x and the third distancey of the first and second calibration lines c₁ and c₂, respectively,from a second object of the calibration system 300 may be estimated. Thesecond distance x and the third distance y are estimated based on atleast the known distance d, the first observed width w₁, and the secondobserved width w₂.

Further, the distance data set for the plurality of rows of pixels (suchas the second plurality of rows of pixels) in the first image 304 may beestimated based on at least the width (such as the third width w₃) ofthe line (such as the third line) corresponding to each of the secondplurality of rows of pixels and one of the first calibration line c₁ orthe second calibration line c₂. The third width w₃ may be estimatedbased on at least the plurality of calibration lines and each row ofpixels of the second plurality of rows of pixels. The distance data setmay further include at least the second distance x and the thirddistance y. The first image 304 may comprise the first plurality of rowsof pixels and the second plurality of rows of pixels. The retrieveddistance value may be associated with the fourth row of pixels in thefirst image 304 having a row number that is equal to a row number of thethird row of pixels in the second image 500. Upon prediction of thefirst distance of the first object from the vehicle 102, the processor108 may be configured to generate the warning message based on at leastthe predicted distance. The processor 108 may be further configured tocommunicate the warning message to the driver of the vehicle 102indicating the impending collision.

Various embodiments of the disclosure provide a non-transitory computerreadable medium having stored thereon, computer executable instructions,which when executed by a computer, cause the computer to executeoperations for calibrating the fixed image-capturing device (such as theimage-capturing device 106) of the vehicle 102. The operations includeidentifying, by the vehicle device 104, the first plurality of rows ofpixels (such as the first and second rows of pixels r₁ and r₂) in thefirst image 304. The first image 304 may be captured by theimage-capturing device 106. The first image 304 may include theplurality of calibration lines (such as the first and second calibrationlines c₁ and c₂). The first calibration line c₁ of the plurality oflines is at the known distance d from the second calibration line c₂ ofthe plurality of lines. The first plurality of rows of pixels maycorrespond to the plurality of calibration lines. The operations furtherinclude estimating, by the vehicle device 104, the second distance x andthe third distance y of the first and second calibration lines c₁ andc₂, respectively, from the image-capturing device 106. The seconddistance x and the third distance y are estimated based on at least theknown distance d, the first observed width w₁, and the second observedwidth w₂. The operations further include estimating, by the vehicledevice 104, the focal length F of the image-capturing device 106. Thefocal length F may be estimated based on at least the first calibrationline c₁ or the second calibration line c₂. The operations furtherinclude estimating, by the vehicle device 104, the fifth distance ofeach row of pixels of the second plurality of rows of pixels in thefirst image 304 from the image-capturing device 106. The fifth distancemay be estimated based on at least the focal length F and the width(such as the third width w₃) of the line (such as the third line)corresponding to each row of pixels. The third width w₃ may be estimatedbased on at least the plurality of calibration lines and each row ofpixels of the second plurality of rows of pixels. The first plurality ofrows of pixels and the second plurality of rows of pixels may constitutethe first image. The operations further include storing, by the vehicledevice 104, the distance data set including at least the second distancex, the third distance y, and the fifth distance in the memory (such asthe memory 110). Further, a distance of an object from another objectmay be predicted based on the stored distance data set and an image ofthe object.

Various embodiments of the disclosure provide a non-transitory computerreadable medium having stored thereon, computer executable instructions,which when executed by a computer, cause the computer to executeoperations for predicting the first distance of the first object fromthe vehicle 102. The operations include capturing, by theimage-capturing device 106 of the vehicle device 104, the image (such asthe second image 500) of the first object. The operations furtherinclude detecting, by the processor 108 of the vehicle device 104, thefirst bottom edge of the first object based on the second image 500. Theoperations further include identifying, by the processor 108, the row ofpixels (such as the third row of pixels) in the second image 500corresponding to the detected bottom edge. The operations furtherinclude predicting, by the processor 108, the first distance of thefirst object from the vehicle 102 based on a distance value retrievedfrom the distance data set that may be stored in the memory 110 of thevehicle device 104 or a separate memory device installed in the vehicle102. The distance value may be retrieved from the distance data setbased on at least the third row of pixels.

The distance data set may be estimated by executing one or morecalibration operations. For example, the plurality of rows of pixels(such as first plurality of rows of pixels) in the image (such as thefirst image 304) including the plurality of calibration lines may beidentified. The first plurality of rows of pixels may correspond to theplurality of calibration lines. The first calibration line c₁ of theplurality of calibration lines is the known distance d from the secondcalibration line c₂ of the plurality of calibration lines. Further, thesecond distance x and the third distance y of the first and secondcalibration lines c₁ and c₂, respectively, from a second object of thecalibration system may be estimated. The second distance x and the thirddistance y are estimated based on at least the known distance d, thefirst observed width w₁, and the second observed width w₂.

Further, the distance data set for the plurality of rows of pixels (suchas the second plurality of rows of pixels) in the first image 304 may beestimated based on at least the width (such as the third width w₃) ofthe line (such as the third line) corresponding to each of the secondplurality of rows of pixels and one of the first calibration line c₁ orthe second calibration line c₂. The third width w₃ may be estimatedbased on at least the plurality of calibration lines and each row ofpixels of the second plurality of rows of pixels. The distance data setmay further include at least the second distance x and the thirddistance y. The first image 304 may comprise the first plurality of rowsof pixels and the second plurality of rows of pixels. The retrieveddistance value may be associated with the fourth row of pixels in thefirst image 304 having a row number that is equal to a row number of thethird row of pixels in the second image 500. Upon prediction of thefirst distance of the first object from the vehicle 102, the processor108 may be configured to generate the warning message based on at leastthe predicted distance. The processor 108 may be further configured tocommunicate the warning message to the driver of the vehicle 102indicating the impending collision.

The disclosed embodiments encompass numerous advantages. The disclosureprovides various methods and systems for predicting the first distanceof the first object from the vehicle 102 based on the distance data setthat is estimated in the calibration phase. The first and second rows ofpixels r₁ and r₂ are identified by way of line correspondences (i.e., aline (such as the first and second calibration lines c₁ and c₂) on theground plane is mapped to a row of pixels in an image (such as the firstimage 304)). Hence, the accuracy of identification of the first andsecond rows of pixels r₁ and r₂ is higher as compared to conventionaldistance prediction approaches that use point correspondences. Further,the calibration of the distance prediction mechanism is performed usinga single frame (i.e., the first image 304 of the calibration system300), thereby eliminating a need to have multiple frames (i.e., images)of a calibration system (e.g., the calibration system 300) forcalibration. Further, based on the determined distance data set, themethods and the systems facilitate predicting far-away objects (e.g.,objects at distances greater than 10 meters) with high accuracy.Further, since the distances of the distance data set may be estimatedbased on the plurality of calibration lines of the calibration system300, and the distances of various objects (such as the first object) maybe predicted based on the distance data set, a need for knowing actualdimensions of the various objects beforehand for predicting distancesfrom the vehicle 102 is eliminated. Thus, the method and the system ofthe present disclosure provide a more efficient, a more effective, and amore accurate way of predicting the first distance of the first objectas compared to a conventional approach of distance prediction.

A person of ordinary skill in the art will appreciate that embodimentsand exemplary scenarios of the disclosed subject matter may be practicedwith various computer system configurations, including multi-coremultiprocessor systems, minicomputers, mainframe computers, computerslinked or clustered with distributed functions, as well as pervasive orminiature computers that may be embedded into virtually any device.Further, the operations may be described as a sequential process,however some of the operations may in fact be performed in parallel,concurrently, and/or in a distributed environment, and with program codestored locally or remotely for access by single or multiprocessormachines. In addition, in some embodiments, the order of operations maybe rearranged without departing from the spirit of the disclosed subjectmatter.

Techniques consistent with the disclosure provide, among other features,systems and methods for predicting the first distance of the firstobject from the vehicle 102. While various exemplary embodiments of thedisclosed systems and methods have been described above, it should beunderstood that they have been presented for purposes of example only,and not limitations. It is not exhaustive and does not limit thedisclosure to the precise form disclosed. Modifications and variationsare possible in light of the above teachings or may be acquired frompracticing of the disclosure, without departing from the breadth orscope.

While various embodiments of the disclosure have been illustrated anddescribed, it will be clear that the disclosure is not limited to theseembodiments only. Numerous modifications, changes, variations,substitutions, and equivalents will be apparent to those skilled in theart, without departing from the spirit and scope of the disclosure, asdescribed in the claims.

What is claimed is:
 1. A method comprising: identifying, by circuitry,in a first image including at least a plurality of lines, a firstplurality of rows of pixels corresponding to the plurality of lines,wherein a first line of the plurality of lines is at a known distancefrom a second line of the plurality of lines; estimating, by thecircuitry, a first distance of the first line and a second distance ofthe second line, from an image-capturing device used for capturing thefirst image, wherein the first distance and the second distance areestimated based on at least the known distance, a first width of thefirst line in the first image, and a second width of the second line inthe first image; estimating, by the circuitry, a third distance of athird line corresponding to each row of pixels of a second plurality ofrows of pixels in the first image from the image-capturing device basedon at least a focal length of the image-capturing device and a thirdwidth of the third line corresponding to each row of pixels of thesecond plurality of rows of pixels, wherein the third width is estimatedbased on at least the plurality of lines and each row of pixels of thesecond plurality of rows of pixels; and storing, by the circuitry in amemory, a distance data set including at least the first distance, thesecond distance, and the third distance, wherein a fourth distance of afirst object from a second object is predicted based on the storeddistance data set and a second image of the first object.
 2. The methodof claim 1, further comprising: converting, by the circuitry, the firstimage from a first color model to a second color model; filtering, bythe circuitry, the converted first image to obtain a filtered firstimage including a known color; and identifying, by the circuitry, thefirst plurality of rows of pixels from the filtered first image.
 3. Themethod of claim 2, wherein the first and second color models are atleast one of a black and white color model, a greyscale color model, ared, green, and blue (RGB) color model, a hue, saturation, and value(HSV) color model, a cyan, magenta, yellow, and black (CMYK) colormodel, a hue, saturation, and brightness (HSB) color model, a hue,saturation, and lightness (HSL) color model, or a hue, chroma, and value(HCV) color model, and wherein the first color model is different fromthe second color model.
 4. The method of claim 1, further comprising:estimating, by the circuitry, the focal length of the image-capturingdevice based on at least one of the first line or the second line. 5.The method of claim 1, wherein the first image comprises the first andsecond pluralities of rows of pixels.
 6. The method of claim 1, furthercomprising: detecting, by the circuitry, a bottom edge of the firstobject based on the second image; identifying, by the circuitry, a thirdrow of pixels in the second image corresponding to the detected bottomedge; and retrieving, by the circuitry from the memory, a distance valuecorresponding to a fourth row of pixels associated with the first imagebased on the third row of pixels, wherein the retrieved distance valueindicates the fourth distance of the first object from the secondobject, and wherein a row number of the third row of pixels is equal toa row number of the fourth row of pixels.
 7. A method, comprising:capturing, by an image-capturing device of a vehicle device installed ina vehicle, a first image of a first object; detecting, by a processor ofthe vehicle device, a bottom edge of the first object based on the firstimage; identifying, by the processor, a first row of pixels in the firstimage corresponding to the detected bottom edge; and predicting, by theprocessor, a first distance of the first object from the vehicle basedon a distance value, wherein the distance value is retrieved, based onthe first row of pixels, from a distance data set stored in a memory ofthe vehicle device, and wherein the stored distance data set isestimated using steps comprising: identifying, in a second imageincluding at least a plurality of lines, a second plurality of rows ofpixels corresponding to the plurality of lines, wherein a first line ofthe plurality of lines is at a known distance from a second line of theplurality of lines; estimating a second distance of the first line and athird distance of the second line, from a second object, wherein thesecond distance and the third distance are estimated based on at leastthe known distance, a first width of the first line in the second image,and a second width of the second line in the second image; andestimating the distance data set of a third line corresponding to eachrow of pixels of a third plurality of rows of pixels in the second imagefrom the second object based on at least a third width of the third linecorresponding to each row of pixels of the third plurality of rows ofpixels and one of the first line or the second line, wherein thedistance data set further includes at least the second distance and thethird distance.
 8. The method of claim 7, wherein the second pluralityof rows of pixels are identified using steps comprising: converting thesecond image from a first color model to a second color model; filteringthe converted second image to obtain a filtered image including a knowncolor; and identifying the second plurality of rows of pixels from thefiltered second image.
 9. The method of claim 8, wherein the first andsecond color models are at least one of a black and white color model, agreyscale color model, a red, green, and blue (RGB) color model, a hue,saturation, and value (HSV) color model, a cyan, magenta, yellow, andblack (CMYK) color model, a hue, saturation, and brightness (HSB) colormodel, a hue, saturation, and lightness (HSL) color model, or a hue,chroma, and value (HCV) color model, and wherein the first color modelis different from the second color model.
 10. The method of claim 7,wherein the second image comprises the second and third pluralities ofrows of pixels.
 11. The method of claim 7, wherein the third width isestimated based on at least the plurality of lines and each row ofpixels of the third plurality of rows of pixels.
 12. The method of claim7, wherein the retrieved distance value is associated with a fourth rowof pixels in the second image, and wherein a row number of the first rowof pixels in the first image is equal to a row number of the fourth rowof pixels in the second image.
 13. The method of claim 7, furthercomprising: generating, by the processor, a warning message based on atleast the first distance of the first object from the vehicle; andcommunicating, by the processor to a driver of the vehicle, the warningmessage indicating an impending collision.
 14. A system, comprising: animage-capturing device configured to: capture a first image of a firstobject; and a processor configured to: detect a bottom edge of the firstobject based on the first image; identify a first row of pixels in thefirst image corresponding to the detected bottom edge; and predict afirst distance of the first object from a vehicle based on a distancevalue, wherein the distance value is retrieved, based on the first rowof pixels, from a distance data set stored in a memory, and wherein thestored distance data set is estimated using steps comprising:identifying, in a second image including at least a plurality of lines,a second plurality of rows of pixels corresponding to the plurality oflines, wherein a first line of the plurality of lines is at a knowndistance from a second line of the plurality of lines; estimating asecond distance of the first line and a third distance of the secondline, from a second object, wherein the second distance and the thirddistance are estimated based on at least the known distance, a firstwidth of the first line in the second image, and a second width of thesecond line in the second image; and estimating the distance data set ofa third line corresponding to each row of pixels of a third plurality ofrows of pixels in the second image from the second object based on atleast a third width of the third line corresponding to each row ofpixels of the third plurality of rows of pixels and one of the firstline or the second line, wherein the distance data set further includesat least the second distance and the third distance.
 15. The system ofclaim 14, wherein the second plurality of rows of pixels are identifiedusing steps comprising: converting the second image from a first colormodel to a second color model; filtering the converted second image toobtain a filtered second image including a known color; and identifyingthe second plurality of rows of pixels from the filtered second image.16. The system of claim 15, wherein the first and second color modelsare at least one of a black and white color model, a greyscale colormodel, a red, green, and blue (RGB) color model, a hue, saturation, andvalue (HSV) color model, a cyan, magenta, yellow, and black (CMYK) colormodel, a hue, saturation, and brightness (HSB) color model, a hue,saturation, and lightness (HSL) color model, or a hue, chroma, and value(HCV) color model, and wherein the first color model is different fromthe second color model.
 17. The system of claim 14, wherein the secondimage comprises the second and third pluralities of rows of pixels. 18.The system of claim 14, wherein the third width is estimated based on atleast the plurality of lines and each row of pixels of the thirdplurality of rows of pixels.
 19. The system of claim 14, wherein theretrieved distance value is associated with a fourth row of pixels inthe second image, and wherein a row number of the first row of pixels inthe first image is equal to a row number of the fourth row of pixels inthe second image.
 20. The system of claim 14, wherein the processor isfurther configured to: generate a warning message based on at least thefirst distance of the first object from the vehicle; and communicate thewarning message to a driver of the vehicle indicating an impendingcollision.